package com.fit.entities;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;

import org.apache.tapestry5.beaneditor.NonVisual;
import org.apache.tapestry5.beaneditor.Validate;

@Entity
@Table(name = "manufacturer")
public class Manufacturer {

	@Id
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	@NonVisual
	@Column(name = "id")
	private Long id;
	@Column(name = "company", nullable = false)
	@Validate("required")
	private String company;
	@Validate("required")
	@Column(name = "warranty", nullable = false)
	private int warranty;
	@Validate("required")
	@Column(name = "country", nullable = false)
	private String country;
	@Validate("required")
	@ManyToOne(optional = false)
	@JoinColumn(name = "manufacturer_wholesale")
	private Wholesale wholesale;
	public Long getId() {
		return id;
	}
	public void setId(Long id) {
		this.id = id;
	}
	public String getCompany() {
		return company;
	}
	public void setCompany(String company) {
		this.company = company;
	}
	public int getWarranty() {
		return warranty;
	}
	public void setWarranty(int warranty) {
		this.warranty = warranty;
	}
	public String getCountry() {
		return country;
	}
	public void setCountry(String country) {
		this.country = country;
	}
	
	public Wholesale getWholesale() {
		return wholesale;
	}
	public void setWholesale(Wholesale wholesale) {
		this.wholesale = wholesale;
	}


	

}
